import {Injectable} from '@angular/core';

import {Storage} from '@ionic/storage';

@Injectable()
export class UserData {

  constructor(public storage: Storage) {
  }

  setUsername(username: string): void {
    this.storage.set('username', username);
  }

  getUsername(): Promise<string> {
    return this.storage.get('username').then((value) => {
      return value;
    });
  }
  
}